package com.google.android.apps.wakemewhere.ui;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.preference.DialogPreference;
import android.util.AttributeSet;

public class LocationPreference extends DialogPreference {
	
	private Activity activity = null;
	
	public LocationPreference(Context context, AttributeSet attrs) {
		super(context, attrs);
	}
	
	public void setActivity(Activity value) {
		this.activity = value;
	}
	
	@Override
	protected void onClick() {
		if (activity != null) {
			Intent intent = new Intent(getContext(), LocationPickerActivity.class);
			activity.startActivityForResult(intent, 0);
		}
	}
}
